package com.freecloud.javabasics.design.bridging;

import com.freecloud.javabasics.design.bridging.message.*;

/**
 * 桥接模式：将抽象部分与具体实现进行分离
 * @Author: maomao
 * @Date: 2020-03-08 21:32
 */
public class BridgingDemo {


    public static void main(String[] args) {

        IMessage message = new SmsMessage();
        AbstractMessage abstractMessage = new NomalMessage(message);

        abstractMessage.sendMessage("加班申请","张三");

        message = new EmailMessage();
        abstractMessage = new UrgencyMessage(message);

        abstractMessage.sendMessage("加班申请","李四");
    }

}
